/** \file qwwmenu.cpp
 * \brief QWordWizard menu implementation
 */

#include "qwwmenu.h"

QWWMenu::QWWMenu(QWidget *parent):
    mp_tray(new QSystemTrayIcon(parent)),
    mp_tray_menu(new QMenu(parent)),
    mp_show_hide_action(new QAction(QObject::tr("Hide"), parent)),
    mp_move_freeze_action(new QAction(QObject::tr("Move"), parent)),
    mp_about_action(new QAction(QObject::tr("About"), parent)),
    mp_settings_action(new QAction(QObject::tr("Settings..."), parent)),
    mp_quit_action(new QAction(QObject::tr("Quit"), parent)),
    mp_active_icon(new QIcon(":images/qwordwizard.png")),
    mp_inactive_icon(new QIcon(":images/hidden.png"))
{
    mp_tray->setIcon(*mp_active_icon);
    mp_tray->show();

    mp_tray_menu->addAction(mp_show_hide_action.get());
    mp_tray_menu->addAction(mp_move_freeze_action.get());
    mp_tray_menu->addSeparator();
    mp_tray_menu->addAction(mp_about_action.get());
    mp_tray_menu->addAction(mp_settings_action.get());
    mp_tray_menu->addSeparator();
    mp_tray_menu->addAction(mp_quit_action.get());

    mp_tray->setContextMenu(mp_tray_menu.get());
}


QWWMenu::~QWWMenu()
{

}
